import request from '@/utils/request'

// export function getRoutes() {
//   return request({
//     url: '/routes',
//     method: 'post'
//   })
// }

export function getRoles() {
  return request({
    url: '/user/getRoleList',
    method: 'post'
  })
}

export function addRole(data) {
  return request({
    url: '/user/addRole',
    method: 'post',
    contentType: 'application/json',
    data
  })
}

export function updateUserRole(data) {
  return request({
    url: `/user/updateUserRole`,
    method: 'post',
    contentType: 'application/json',
    data
  })
}

export function updateRoleMenu(data) {
  return request({
    url: `/user/updateRoleMenu`,
    method: 'post',
    contentType: 'application/json',
    data: data
  })
}

export function deleteRole(data) {
  return request({
    url: `/user/deleteRole`,
    method: 'post',
    contentType: 'application/json',
    data: data
  })
}

export function getMenuList() {
  return request({
    url: `/user/getMenuList`,
    method: 'post'
  })
}

export function deleteMenu(data) {
  return request({
    url: `/user/deleteMenu`,
    method: 'post',
    contentType: 'application/json',
    data
  })
}

export function addMenu(data) {
  return request({
    url: `/user/addMenu`,
    method: 'post',
    contentType: 'application/json',
    data
  })
}

